const express = require('express');

const router = express.Router();

const storeService = require('../service/store');

router.get('/allGoods', async function (req, res, next) {
    // 调用系统的业务层
    let result = await storeService.allGoods();
    return res.json(result);
});

router.get('/goods', async function (req, res, next) {
    // 接收前端发来的商品id
    let id = req.query.id;
    // 调用系统的业务层
    let result = await storeService.goods(id);
    return res.json(result);
});

module.exports = router;
